Skip to content

fix(connection): send an explicit empty --description - #509

Open
pcbeingused33 wants to merge 1 commit into
hookdeck:mainfrom
pcbeingused33:fix/connection-clear-description
Open

pcbeingused33 wants to merge 1 commit into
hookdeck:mainfrom
pcbeingused33:fix/connection-clear-description

Conversation

@pcbeingused33

Copy link
Copy Markdown
Contributor

gateway connection upsert my-conn --description "" reports success but keeps the stored description. gateway connection update <id> --description "" sends no update at all and just prints the current connection.

Cause: both commands only set description on the request when the value is non-empty, so an explicit empty value is indistinguishable from an omitted flag.

Fix: send the field whenever --description was given, following the same idea as the --rules '[]' handling from #472. The connection PUT endpoints accept an empty string, and --description is not one of the flags that reject empty values. Omitting the flag still leaves the stored description untouched.

This only covers connections; the source and destination commands are not changed here.

Tests: new tests in pkg/cmd/connection_description_test.go capture the PUT body for upsert (empty value sent, omitted flag not sent) and update (empty value sent). The empty-value cases fail on main and pass with the change. go vet ./pkg/cmd/ and go test ./pkg/cmd/ pass. The tests use a stub API; this was not run against the live service.

AI assistance (Claude Code) was used to prepare this change.

connection upsert and connection update dropped --description "" from the request, so the stored description was kept while the command reported success. Send the field whenever the flag was given.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant